package com.bachelor.community.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.sql.Timestamp;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors(chain = true)
public class User {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String account;
    private String username;
    private String password;
    private String email;
    private String classNumber;
    private String introduction;
    private Integer role;
    @Builder.Default
    private String avatar = "https://images.nowcoder.com/head/1t.png";
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Timestamp createTime;

    private Integer credit;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Timestamp lastLogin;

    @Builder.Default
    private Boolean status = true;
}
